package com.xuanwu.ai.flow.service;

import com.xuanwu.ai.flow.mapper.ComponentMapper;
import com.xuanwu.ai.flow.model.AIComponent;
import com.xuanwu.ai.jdbc.mybatis.LambdaExcludeEmptyQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ComponentServiceImpl {
    @Autowired
    private ComponentMapper componentMapper;

    /**
     * 获取组件列表
     *
     * @return
     */
    public List<AIComponent> getComponentList() {

        List<AIComponent> list = componentMapper.selectList(new LambdaExcludeEmptyQueryWrapper<AIComponent>()
                .orderByAsc(AIComponent::getName));

        return list;

    }
}
